package com.tan.springcloud.Controller;



import com.tan.springcloud.Service.Orderclient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
@RestController
@Slf4j
public class Consumer {

    @Resource
    private Orderclient orderclient;

    @GetMapping("/consumer/get/{id}")
    public String getHystrixService(@PathVariable("id") Integer id) {
//        String hystrix = Consumer.getHystrixService(id);
//        log.info("*********"+hystrix);
//        return hystrix;
        return orderclient.getHystrixService(id);
    }
    @GetMapping("/conumer/get/{id}")
    public String getHystrixService01(@PathVariable("id") Integer id) {
//        String hystrix = Consumer.getHystrixService01(id);
//        log.info("*********"+hystrix);
//        return hystrix;
        return orderclient.getHystrixService01(id);
    }

}

